<?php

namespace backend\controllers;

use Yii;
use common\models\Settings;
use backend\models\SettingsSearch;
use backend\components\CRUDController;
use yii\web\NotFoundHttpException;

/**
 * SettingsController implements the CRUD actions for Settings model.
 */
class SettingsController extends CRUDController
{

    protected  function findModel($id = null,$search = false)
    {
        if($search){
            $model = new SettingsSearch();
        }else if(empty($id)){
            $model = new Settings();
        }else{
            if (($model = Settings::findOne($id)) == null) {
                throw new NotFoundHttpException('The requested page does not exist.');
            }
        }
        return $model;
    }


}
